<template>
    <div class="mui-numbox" data-numbox-step='1' data-numbox-min='0' data-numbox-max='100'>
        <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
        <input class="mui-numbox-input" type="number" value="1" @change="giveValue" ref="count" />
        <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
    </div>
</template>
<script>
import mui from "../../../node_modules/mui/js/mui";
export default {
    props:['max'],
    watch: {
        max: function(newVal) {
        mui(".mui-numbox")
            .numbox().setOption("max", newVal);
        }
    },
    mounted() {
        mui(".mui-numbox").numbox();
    },
    methods: {
        giveValue() {
            this.$emit("giveF", parseInt(this.$refs.count.value));
        }
    }
}
</script>
<style lang="scss" scoped>

</style>
